#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
  Обработчик форм
"""

import logging
from engine import settings
from engine.data import feedback
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

# enable info logging by the app
logging.getLogger().setLevel(logging.INFO)

class FormHandler(webapp.RequestHandler):
  def post(self, category):
    if category == '/about':        # форма о нас
      form = { 'author': self.request.get('author'),
               'mail': self.request.get('mail'),
               'message': self.request.get('message') }
      feedback.AddMsg(form)

    self.redirect(category)